package com.woniuxy.microsportsserver.walkmag.controller;

import com.woniuxy.microsportsserver.bean.WalkAnalysisInfo;
import com.woniuxy.microsportsserver.walkmag.service.IWalkService;
import org.springframework.data.redis.core.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RequestMapping("/redis")
@RestController
public class RedisController {

    @Resource
    private RedisTemplate redisTemplate;

    @Resource
    private ValueOperations valueOperations;

    @Resource
    private ListOperations listOperations;

    @Resource
    private ZSetOperations zSetOperations;

    @Resource
    private HashOperations hashOperations;

    @Resource
    private IWalkService walkService;


    @RequestMapping("/packFull")
    public void string(){
        List<WalkAnalysisInfo> datas = walkService.findNumAvgBytimeType();
        listOperations.leftPushAll("walkavg",datas);

    }

}
